let http = require("http");
let fs = require("fs");
let num = 0;
// 创建一个http服务
let server = http.createServer((request,response) => {
    // 读取服务器.html并响应给客户端
    // console.log(request);
    // console.log(response);
    num++;
    // console.log(`已有${num}人访问我的网站`);
    console.log(request.url);

    let read = fs.readFileSync("./服务器.html");
    response.end( read.toString("utf-8") );
});

// 启动http服务监听
server.listen(3008,() => {
    console.log("服务器正在运行");
});